namespace SmartMathLibrary
{
    /// <summary>
    /// Interface to implement a NewtonPolynomial class.
    /// </summary>
    public interface INewtonPolynomial
    {
        /// <summary>
        /// Gets the coefficients of the polynomial.
        /// </summary>
        /// <value>The coefficients of the polynomial.</value>
        double[] Coefficients { get; }

        /// <summary>
        /// Gets the x values of the polynomial.
        /// </summary>
        /// <value>The x values of the polynomial.</value>
        double[] XValues { get; }

        /// <summary>
        /// Gets or sets the constant value of the polynomial.
        /// </summary>
        /// <value>The constant value of the polynomial.</value>
        double ConstantValue { get; set; }

        /// <summary>
        /// Compares the current instance to the specified polynomial.
        /// </summary>
        /// <param name="compare">The polynomial to compare.</param>
        /// <returns>True if both polynomials are even otherwise, false.</returns>
        bool CompareTo(NewtonPolynomial compare);

        /// <summary>
        /// Solves the  polynomial at the specified position x.
        /// </summary>
        /// <param name="x">The value for evaluation.</param>
        /// <returns>The result f(x) at the specified position x.</returns>
        double SolveAt(double x);

        /// <summary>
        /// Converts the Newton polynomial to a normal polynomial.
        /// </summary>
        /// <returns>The converted polynomial.</returns>
        SimplePolynomial ToPolynomial();
    }
}